package com.atguigu.rabitmq.consumer.listener05;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class ConsumerListenerTopic {

    @RabbitListener(queues = "topic_queue_01")
    public void consumer01(Message message) {
        byte[] body = message.getBody();
        String msg = new String(body);
        System.out.println("consumer01 ...msg ----> " + msg);
    }

    @RabbitListener(queues = "topic_queue_02")
    public void consumer02(Message message) {
        byte[] body = message.getBody();
        String msg = new String(body);
        System.out.println("consumer02....msg ----> " + msg);
    }
}